## Test script for testing remote RPC CALLS WHICH NEED
## admin authentication
##
## Usage: python registerNode.py adminuser adminpass [local]
import os,sys
import xmlrpclib

user=sys.argv[1]
pw=sys.argv[2]
if len(sys.argv)==4:
    #assume local mode
    server_url = 'http://%s:%s@localhost:8000/provisioner/xmlrpc/call/xmlrpc' % (user,pw)
else:
    server_url = 'http://%s:%s@update.braintrainerplus.com/xmlrpc/call/xmlrpc' % (user,pw)
server = xmlrpclib.Server(server_url)

print server.giveMeTime()
mac1=raw_input("Mac 1:")
mac2=raw_input("Mac 2:")
name=raw_input("Qiosq node name:")
tags=raw_input("Tags:")
print server.registerNode(name,mac1,mac2,name) 
print server.tagNode(mac1,mac2,tags)
